home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / misc / sci / Squid.lha / Squid / squid_functions.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-30  |  2.0 KB  |  81 lines

  1. #include <math.h>
  2.  
  3. BOOL IO_boucle();
  4. void update_color(int&, int&);
  5. void circle_param(int, int, int, int&, int&, float);
  6.  
  7. BOOL IO_boucle()
  8. {
  9.     BOOL pause=FALSE, close=FALSE;
  10.     Emperor_Input=0L;
  11.     //do
  12.     //{
  13.         while((Emperor_Input = RA_HandleInput(WindowObject1, &Emperor_Code)) != WMHI_LASTMSG)
  14.         {
  15.             switch(Emperor_Input & WMHI_CLASSMASK)
  16.             {
  17.                 case WMHI_GADGETUP:
  18.                     switch(Emperor_Input & WMHI_GADGETMASK)
  19.                     {
  20.                         /*case 15:
  21.                             if(pause==TRUE)
  22.                             {
  23.                                 pause=FALSE;
  24.                             }
  25.                             else
  26.                             {
  27.                                 pause=TRUE;
  28.                             }
  29.                             break;*/
  30.                         case 12:
  31.                             //SetGadgetAttrs(Button3, Window1, NULL, GA_Selected, FALSE, TAG_DONE);
  32.                             Emperor_SetGadgetAttr(String1, " ");
  33.                             //pause=FALSE;
  34.                             close=TRUE;
  35.                             return close;
  36.                             break;
  37.                         default:
  38.                             //pause=FALSE;
  39.                             break;
  40.                     }
  41.                 default:
  42.                     //pause=FALSE;
  43.                     break;
  44.             }
  45.         }
  46.     //}
  47.     //while(pause==TRUE);
  48. }
  49.  
  50. void update_color()
  51. {
  52.  
  53. }
  54.  
  55. void circle_param(int tempr, int i, int j, int& x, int& y, float alpha)
  56. {
  57.     float tempx=0.0, tempy=0.0, arrx=0.0, arry=0.0;
  58.     tempx = tempr * cos(alpha);
  59.     arrx = floor(tempx);
  60.     if((tempx-arrx)<0.5)
  61.     {
  62.         tempx=floor(tempx);
  63.     }
  64.     else
  65.     {
  66.         tempx=ceil(tempx);
  67.     }
  68.     tempy = tempr * sin(alpha);
  69.     arry = floor(tempy);
  70.     if((tempy-arry)<0.5)
  71.     {
  72.         tempy=floor(tempy);
  73.     }
  74.     else
  75.     {
  76.         tempy=ceil(tempy);
  77.     }
  78.     x = i + int(tempx);
  79.     y = j + int(tempy);
  80. }
  81.